var baseUrl='';
if (process.env.NODE_ENV === 'development') {
    baseUrl = 'http://api.midoyx.com';
} else if (process.env.NODE_ENV === 'production') {
    baseUrl = 'http://api.midoogame.com';
}
module.exports = {
  /*
  ** Headers of the page
  */
  head: {
    title: 'demo',
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: 'a first nuxt demo' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
      //{rel:'stylesheet',type:'text/css',href:'//cdn.bootcss.com/Swiper/3.4.2/css/swiper.min.css'},
      //,{ rel: 'stylesheet', type: 'text/css', href: '/main.css' }
      ,{rel:'stylesheet',type:'text/css',href:'//js.jxft.net/html/channel/2018index/images/style.css?2018042801a'}

    ],
    script:[
      //{type:'text/javascript',src:'//cdn.bootcss.com/Swiper/3.4.2/js/swiper.min.js'}
    ]
  },
  modules: [ '@nuxtjs/axios'],
  axios: {  proxy: true },//prefix: '/api/',
  proxy: {
    "/wapauth":{
      target: 'http://www.midoogame.com', // 
      pathRewrite: { '^/wapauth': '' }
    },
    "/php":{
      target: baseUrl, // 
      pathRewrite: { '^/php': '' }
    },
    /*"/sms":'http://www.midoogame.com/wapauth/sendmobilecode',
    "/reg":'http://www.midoogame.com/wapauth/register',//注册
    "/reset":'http://www.midoogame.com/wapauth/forgotpw',//忘记密码
    "/indexs": `${baseUrl}/index/index`,
    "/list":`${baseUrl}/index/indextypegamelist`,
    "/listmore":`${baseUrl}/index/getoneindextypegame`,
    "/gameDet":`${baseUrl}/stat/gameinfo`,
    "/gamelist":`${baseUrl}/stat/gamelist`*/
},
  /*
  ** Customize the progress bar color
  */
  loading: { color: '#fea901' },
  plugins: [
    { src: '~plugins/flexible.js', ssr: false },
    { src: '~plugins/swiper.js', ssr: false }
  ],
  css:[
    'swiper/dist/css/swiper.css'
  ],
  cache: true,
  /*
  ** Build configuration
  */
  build: {
    /*
    ** Run ESLint on save
    */
    vendor: ['axios'],
    extend (config, { isDev, isClient }) {
      if (isDev && isClient) {
        config.module.rules.push({
          enforce: 'pre',
          test: /\.(js|vue)$/,
          loader: 'eslint-loader',
          exclude: /(node_modules)/
        })
      }
    }
  }
}

